Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model import: parallelize computation of derivatives #1740

Merged
merged 3 commits into from Mar 25, 2022

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Mar 24, 2022

Allows to compute derivatives in parallel (using multiprocessing). Disabled by default. Enable by setting environment variable AMICI_IMPORT_NPROCS to the number of processes to use. For smaller models, the multiprocessing overhead dominates, therefore, this is only advisable to use for larger models (import time of ⪆ 5min).

Closes #1739

@codecov
Copy link

codecov bot commented Mar 24, 2022

Codecov Report

Merging #1740 (09085b5) into develop (f60957b) will increase coverage by 9.28%.
The diff coverage is 70.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1740      +/-   ##
===========================================
+ Coverage    68.58%   77.86%   +9.28%     
===========================================
  Files           29       73      +44     
  Lines         4132    11372    +7240     
===========================================
+ Hits          2834     8855    +6021     
- Misses        1298     2517    +1219     
Flag Coverage Δ
cpp 74.76% <ø> (?)
petab 62.51% <70.00%> (-0.01%) ⬇️
python 68.19% <70.00%> (?)
sbmlsuite 87.94% <70.00%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
python/amici/ode_export.py 92.30% <70.00%> (+4.71%) ⬆️
src/exception.cpp 74.19% <0.00%> (ø)
include/amici/sundials_linsol_wrapper.h 100.00% <0.00%> (ø)
src/abstract_model.cpp 4.06% <0.00%> (ø)
src/rdata.cpp 93.76% <0.00%> (ø)
src/forwardproblem.cpp 90.64% <0.00%> (ø)
src/simulation_parameters.cpp 71.42% <0.00%> (ø)
src/backwardproblem.cpp 63.73% <0.00%> (ø)
ThirdParty/gsl/gsl/gsl-lite.hpp 95.34% <0.00%> (ø)
src/edata.cpp 88.05% <0.00%> (ø)
... and 50 more

@dweindl
Copy link
Member Author

dweindl commented Mar 24, 2022

Tested with https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab/tree/master/Benchmark-Models/Chen_MSB2009 on 8 core CPU, model import without compilation:

n_procs walltime m:ss
1 4:25.61
2 4:14.30
4 3:39.20
8 3:37.07

@dweindl
Copy link
Member Author

dweindl commented Mar 24, 2022

Tested with https://github.com/ICB-DCM/CS_Signalling_ERBB_RAS_AKT/tree/master/FroehlichKes2018/PEtab:

    n_procs=1 - walltime (m:ss): 25:05.64
    n_procs=2 - walltime (m:ss): 23:25.90
    n_procs=8 - walltime (m:ss): 17:29.66

@dweindl dweindl marked this pull request as ready for review March 24, 2022 10:54
@dweindl dweindl requested a review from FFroehlich March 25, 2022 08:01
@dweindl dweindl linked an issue Mar 25, 2022 that may be closed by this pull request
Copy link
Member

@FFroehlich FFroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 neat !

@dweindl dweindl merged commit c095b00 into develop Mar 25, 2022
@dweindl dweindl deleted the feature_1739_par_jac branch March 25, 2022 15:02
@sonarcloud
Copy link

sonarcloud bot commented Mar 25, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

70.0% 70.0% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Model import: parallelize computation of derivatives
2 participants